var app = getApp();
var commonRequest = function (url, method, data, header) {
  var promise = new Promise(function (resolve, reject) {
    wx.request({
      url: url,
      data: data,
      method: method,
      header: {
        "acctid": app.globalData.acct_id,
        "rdsession":app.globalData.rdsession,
        "openid":app.globalData.openid,
        'content-type': 'application/x-www-form-urlencoded'
      },
      success: resolve,
      fail: reject
    })
  });
  return promise;
};

module.exports.commonRequest = commonRequest 